<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<title>登录</title>
<style type="text/css">
  table, td {
    border-collapse: collapse;
    border: 0
  }
  table {
    margin: auto;
  }
</style>
</head>
<body>
<div style="text-align: center;">
  <form action="${pageContext.request.contextPath}/login" method="post">
    <table>
      <tr>
        <td>用户名称</td>
        <td><input type="text" name="user-name" placeholder="用户名称"></td>
      </tr>
      <tr>
        <td>密码</td>
        <td><input type="password" name="password" placeholder="密码"></td>
      </tr>
      <tr>
        <td><input type="submit" value="登录"></td>
        <td><input type="button" value="注册" onclick="window.location='register'"></td>
      </tr>
    </table>
  </form>
  <c:if test="${error!=null}">
    <span class="error">${requestScope.error}</span>
  </c:if>
</div>
</body>
</html>
